@{
    ViewData["Title"] = "NetnrDoc";
    var code = ViewContext.RouteData.Values["id"]?.ToString();
}
<style>
    .divlist {
        max-height: 500px;
        overflow-y: scroll;
    }

    .dmbox {
        overflow-y: auto;
        max-height: 300px;
        right: 31px !important;
    }
</style>

<div class="container">
    <div class="row">
        <div class="col-md-8 offset-md-2 my-5">
            <div class="py-3 px-2">
                <a href="javascript:void(0)" onclick="AddCatalog()" class="mx-1">添加目录</a>
                <a href="/doc/code/@code" class="mx-2">返回</a>
            </div>
            <div class="divlist">
                <table class="table table-bordered mb-0">
                    <tr>
                        <th style="width:60%">目录名称</th>
                        <th style="width:15%">序号</th>
                        <th>操作</th>
                    </tr>
                </table>
            </div>
            <div class="divlist">
                <table class="table table-bordered table-hover mb-0">
                    <colgroup>
                        <col style="width:60%" />
                        <col style="width:15%" />
                    </colgroup>
                    <tbody id="tlist"></tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal_1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="myModalLabel_1">Title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form id="mbform">
                    <input type="hidden" id="DsCode" name="DsCode" value="@code" />
                    <input type="hidden" name="DsdId" id="DsdId" value="" />
                    <div class="form-group">
                        <label>目录名称</label>
                        <input class="form-control" id="DsdTitle" name="DsdTitle" placeholder="请输入目录名称">
                    </div>
                    <div class="form-group my-4">
                        <label>上级目录</label>
                        <input type="hidden" name="DsdPid" id="DsdPid" />
                        <input id="txtDsdPid" class="form-control dropdown-toggle" data-toggle="dropdown">
                        <div class="dropdown-menu dmbox" id="dmbox"></div>
                    </div>
                    <div class="form-group">
                        <label>序号</label>
                        <input class="form-control" id="DsdOrder" name="DsdOrder" placeholder="请输入序号">
                        <small class="form-text text-muted">越小越靠前，默认99</small>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-light" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="btnSave_1">保存</button>
            </div>
        </div>
    </div>
</div>

<script src="/areas/doc/js/code/catalog.js" asp-append-version="true"></script>